package com.molichuxing.services.business.service;

import java.util.List;
import java.util.Map;

import com.molichuxing.framework.dto.Paged;
import com.molichuxing.framework.service.RootService;
import com.molichuxing.services.business.dto.request.create.OrderSubscribeCreateBizDto;
import com.molichuxing.services.business.dto.request.modify.OrderExpireModifyBizDto;
import com.molichuxing.services.business.dto.request.modify.OrderModifyBizDto;
import com.molichuxing.services.business.dto.request.modify.OrderPayModifyBizDto;
import com.molichuxing.services.business.dto.response.CarOrderBizDto;
import com.molichuxing.services.business.dto.response.OrderCarInfoAppDto;
import com.molichuxing.services.business.dto.response.OrderSubscribeBizDto;
import com.molichuxing.services.business.dto.response.OrderSubscribeDetailsBizDto;
import com.molichuxing.services.business.dto.response.OrderUsedCarBizDto;
import com.molichuxing.services.business.dto.response.UserOrderBizDto;

/**
 * 订阅里程订单组合服务
 * 
 * @author zoumingyu
 * @date 2019年8月12日
 *
 */
public interface OrderSubscribeBizService extends RootService {

	/**
	 * 分页获取订阅里程订单信息
	 * 
	 * @param params
	 *            listType：列表类型-enum <br />
	 *            orderStatus：订单状态-enum <br />
	 *            orderCode：订单号-long <br />
	 *            userIds：用户id-list <br />
	 *            storeIds：门店id-list <br />
	 *            orderTimeStart：下单开始时间-LocalDate <br />
	 *            orderTimeEnd：下单结束时间-LocalDate <br />
	 *            isHaveSuborder：有无续订-boolean
	 * @param pageNum
	 *            页数
	 * @param pageSize
	 *            每页条数
	 * @return
	 * @throws Exception
	 */
	public Paged<OrderSubscribeBizDto> getOrderList(Map<String, Object> params, int pageNum, int pageSize)
			throws Exception;


	/**
	 * 订阅里程订单信息
	 * 
	 * @param orderCode
	 *            订单号
	 * @return
	 */
	public OrderSubscribeBizDto getOrderSubscribe(Long orderCode);

	/**
	 * 订阅里程订单详情信息（包涵交车、还车、加购、结算等相关信息）
	 * 
	 * @param orderCode
	 *            订单号
	 * @return
	 */
	public OrderSubscribeDetailsBizDto getOrderSubscribeDetails(Long orderCode);

	/**
	 * 根据用户id查询订阅里程订单信息
	 * 
	 * @param userId
	 *            用户id
	 * @return
	 */
	public List<UserOrderBizDto> getOrderSubscribeByUser(Integer userId);
	
	/**
	 * 根据车辆id查询订阅里程订单信息
	 * 
	 * @param carId
	 *            车辆id
	 * @return
	 */
	public List<CarOrderBizDto> getOrderSubscribeByCar(Integer carId);

	/**
	 * 根据车辆id查询订阅里程订单信息
	 * 
	 * @param carId
	 *            车辆id
	 * @param storeIds
	 *            门店ids
	 * @return
	 */
	public List<CarOrderBizDto> getOrderSubscribeByCar(Integer carId, List<Integer> storeIds);

	/**
	 * 获取用车实况信息
	 * 
	 * @param orderCode
	 *            订单号
	 * @return
	 */
	public OrderUsedCarBizDto getOrderUsedCar(Long orderCode);

	/**
	 * 根据用户查询用车中的车辆id
	 * 
	 * @param userId
	 *            用户id
	 * @return
	 */
	public List<OrderCarInfoAppDto> getOrderSubscribeCarIdByUser(Integer userId, Integer orderStatus);

	/**
	 * 新增订阅里程订单
	 * 
	 * @param create
	 * @return 订单号
	 */
	public Long createOrderSubscribe(OrderSubscribeCreateBizDto createDto);

	/**
	 * 订单状态修改
	 * 
	 * @param modifyDto
	 * @return
	 */
	public Boolean modifySubscribeStatus(OrderModifyBizDto modifyDto);

	/**
	 * 支付成功后修改订单信息
	 * 
	 * @param modifyDto
	 * @return
	 */
	public Boolean modifyPaySuccess(OrderPayModifyBizDto modifyDto);

	/**
	 * 获取有效订阅续订订单信息（已支付）
	 * 
	 * @param parentOrderCode
	 *            父订单号
	 * @return
	 */
	public OrderSubscribeBizDto getEffectiveOrderSubscribeByParent(Long parentOrderCode);

	/**
	 * 订单到期修改
	 * 
	 * @param modifyBizDtos
	 * @return 返回失败订单号,null则代表全部成功
	 */
	public List<Long> modifyOrderExpire(List<OrderExpireModifyBizDto> modifyBizDtos);

	/**
	 * 订单结算修改
	 * 
	 * @param modifyDto
	 * @return
	 */
	public Boolean modifySettlement(OrderPayModifyBizDto modifyDto);

}
